package pokpok.domaine;

import java.util.List;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;

public class Detail {

	private Integer bestNetValue;
	private List<Tournoi> bestNet;
	private Integer worstNetValue;
	private List<Tournoi> worstNet;
	private Integer bestGainValue;
	private List<Tournoi> bestGain;
	private Integer bestMiseValue;
	private List<Tournoi> bestMise;

	private Set<StatHU> statsHU;

	private SortedMap<Integer, Integer> positions;

	public List<Tournoi> getBestNet() {
		return bestNet;
	}

	public void setBestNet(List<Tournoi> bestNet) {
		this.bestNet = bestNet;
	}

	public List<Tournoi> getWorstNet() {
		return worstNet;
	}

	public void setWorstNet(List<Tournoi> worstNet) {
		this.worstNet = worstNet;
	}

	public List<Tournoi> getBestGain() {
		return bestGain;
	}

	public void setBestGain(List<Tournoi> bestGain) {
		this.bestGain = bestGain;
	}

	public Integer getBestNetValue() {
		return bestNetValue;
	}

	public void setBestNetValue(Integer bestNetValue) {
		this.bestNetValue = bestNetValue;
	}

	public Integer getWorstNetValue() {
		return worstNetValue;
	}

	public void setWorstNetValue(Integer worstNetValue) {
		this.worstNetValue = worstNetValue;
	}

	public Integer getBestGainValue() {
		return bestGainValue;
	}

	public void setBestGainValue(Integer bestGainValue) {
		this.bestGainValue = bestGainValue;
	}

	public List<Tournoi> getBestMise() {
		return bestMise;
	}

	public void setBestMise(List<Tournoi> bestMise) {
		this.bestMise = bestMise;
	}

	public Integer getBestMiseValue() {
		return bestMiseValue;
	}

	public void setBestMiseValue(Integer bestMiseValue) {
		this.bestMiseValue = bestMiseValue;
	}

	public Set<StatHU> getStatsHU() {
		return statsHU;
	}

	public void setStatsHU(Set<StatHU> statsHU) {
		this.statsHU = statsHU;
	}

	public StatHU findOrCreateByAdversaire(Joueur adversaire) {
		if (statsHU == null) {
			return null;
		}
		for (StatHU shu : statsHU) {
			if (shu.getAdversaire().getId().equals(adversaire.getId())) {
				return shu;
			}
		}
		StatHU shu = new StatHU(adversaire, 0, 0);
		statsHU.add(shu);
		return shu;
	}

	public SortedMap<Integer, Integer> getPositions() {
		return positions;
	}

	public void setPositions(SortedMap<Integer, Integer> positions) {
		this.positions = positions;
	}

	public void initPositions() {
		this.positions = new TreeMap<Integer, Integer>();
		this.positions.put(1, 0);
		this.positions.put(2, 0);
		this.positions.put(3, 0);
		this.positions.put(4, 0);
		this.positions.put(5, 0);
		this.positions.put(6, 0);
		this.positions.put(7, 0);
		this.positions.put(8, 0);
		this.positions.put(9, 0);
		this.positions.put(10, 0);
		this.positions.put(11, 0);
	}
}
